package com.hbnrtech.sip.exception;


import lombok.Getter;
import lombok.Setter;

import java.text.MessageFormat;

@Setter
@Getter
public class BusinessException extends RuntimeException {

	/**
	 * 错误码
	 */
	private String code;

	/**
	 * 错误消息
	 */
	private String message;


	public BusinessException(String code, String message, Object[] args) {
		this(code, MessageFormat.format(message, args));
	}


    public BusinessException(String code, String message) {
        this.code = code;
		this.message = message;
    }

	public BusinessException(String message, Object[] args) {
		this.message = MessageFormat.format(message, args);
	}

	public BusinessException(String message) {
		this("0", message);
	}

}
